<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>讲解3次</title>
	</head>
	<body>
		<script>
			alert("老师讲解内容");
			var answer=prompt("大家会了吗  y/n");
			//回答的次数
			var count=1;
			//循环条件：answer=n&&回答次数<=2
			while(answer=='n'&&count<=2){
				alert("老师再讲解一遍");
				answer=prompt("大家会了吗  y/n");
				count++;
			}
			
			alert("放学吧");
		</script>
	</body>
</html>
